<include file="Public/head" />
<div class="tableContainer">
	<div class="tablePanel">
		<div class="edit-title" style="height:56px;">
			<!-- 有title-icon1至title-icon14共14个图标可供选择 -->
			<span class="title-icon11"></span>
			<div><h4 style="float:left;margin-left:10px;"><{:$item['id']?'修改':'添加'}>文字回复</h4></div>
		</div>
		<div class="edit-body">
			<form id="memberform" onsubmit="return false;">
				<input type="hidden" name="info[id]" value="<{$item.id}>" />
    			<input type="hidden" name="info[type]" value="1" />
		        <div class="set-line">
					<div class="set-title">关键词：</div>
					<div class="set-ctrl">
		                <input class="shop_sort_text" name="info[keyword]" value="<{$item.keyword}>" type="text" placeholder="多个规则用逗号分隔，如：help,帮助" />
					</div>
		        </div>
		        <div class="set-line">
					<div class="set-title">回复内容：</div>
					<div class="set-ctrl">
		                <textarea name="info[content]" maxlength="300" style="height:150px;width:400px;" class="shop_sort_text" placeholder="最多可以输入300字"><{$item.content}></textarea>
					</div>
		        </div>
		        <div class="set-line">
		            <div class="set-title">状态：</div>
		            <div class="set-ctrl">
		                <label class="radioLabel">
		                    <input type="radio" name="info[state]" <{:$item['state']!='2'?'checked': ''}> value='1'/> 开放
		                </label>
		                <label class="radioLabel">
		                    <input type="radio" name="info[state]" <{:$item['state']=='2'?'checked': ''}> value='2'> 关闭
		                </label>
		            </div>
		            <div style="clear:both;"></div>
		        </div>
				<div class="clearfloat"></div>
		        <div class="save">
					<span onclick="save(this);return false" id="saveBtn" class="saveBtn" style="float:left;">提交保存</span>
					<span onclick="history.go(-1);" class="saveBtn" style="float:left;margin-left:16px;">返回</span>
					
				</div>
		    </form>
		</div>
	</div>
</div>
<script type="text/javascript">
function save(obj){
    if($("input[name='info[keyword]']").val()==''){
        note_info('请填写关键词',obj,'warn');return;
    }
    if($("textarea[name='info[content]']").val()==''){
        note_info('请填写回复内容',obj,'warn');return;
    }
    
    $.post("<{:U('save_keyword')}>",$('#memberform').serialize(),function(res){
        if(res.status == 1){
            note_info(res.info,obj);
            setTimeout('window.location.href="<{$upPageUrl}>"',1200);
        }else{
            note_info(res.info,obj,'warn');
        }
    },'json');
}
</script>
<include file="Public/foot" />